package com.lin.linchatgpt.exception.handler;

import cn.dev33.satoken.exception.NotLoginException;
import com.lin.linchatgpt.utils.LinResult;
import com.lin.linchatgpt.utils.ResultCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * Copyright(C),2022年-2022,霖霖
 *
 * @author 霖霖
 * @version 1.0
 * @date 2023/6/20 19:36
 * @Description
 */
@RestControllerAdvice
public class NotLoginExceptionHandler {
    @ExceptionHandler(NotLoginException.class)
    public LinResult handlerNotLoginException(NotLoginException e){
        return LinResult.error().code(ResultCode.UNAUTHENTICATED).message("请先登录哦！");
    }
}
